package com.example.administrator.hqq.adapter.module;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.example.administrator.hqq.R;
import com.zhy.view.flowlayout.FlowLayout;
import com.zhy.view.flowlayout.TagAdapter;

import java.util.List;

/**
 * @name: HQQ
 * @describe:
 * @author: 康海涛 QQ2541849981
 * @time: 2018/11/9 17:09
 * @remark:
 */
public class FlowLayoutAdapter extends TagAdapter<String> {
    private Context context;
    private List<String> data;
    public FlowLayoutAdapter(List<String> datas,Context context) {
        super(datas);
        this.data=datas;
        this.context=context;
    }

    @Override
    public View getView(FlowLayout parent, int position, String s) {
        View inflate = LayoutInflater.from(context).inflate(R.layout.search_module_flow_item, null);
        TextView flowTv = inflate.findViewById(R.id.flow_tv);
        flowTv.setText(data.get(position));
        return inflate;
    }
}
